﻿using EmoneyWeiXinCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ActivtyUI.Filter
{
    public class IsOpenFilter : System.Web.Mvc.AuthorizeAttribute
    {
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            return System.Configuration.ConfigurationManager.AppSettings["actIsOpen"] == "1";
        }

        protected override void HandleUnauthorizedRequest(System.Web.Mvc.AuthorizationContext filterContext)
        {
            filterContext.Result = new RedirectResult(Config.Host_Url3 + "Common/ErrorPage?msg=" + "notOpen");
         
        }
    }
}